package com.example.springboot.controller.exception;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author:ChenZhangKun
 * @Date: 2021/6/29 21:54
 */
@RestController
public class ExceptionController {
    @RequestMapping("/ex")
    public String ex() {
        try {
            int i = 1 / 0;
        } catch (Exception ex) {
            throw new ArithmeticException();
        }
        return "运算成功";
    }
}
